// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).

import * as rover from "oci-rover";
import common = require("oci-common");

// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.

const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();

(async () => {
  try {
    // Create a service client
    const client = new rover.RoverClusterClient({ authenticationDetailsProvider: provider });

    // Create a request and dependent object(s).
    const createRoverClusterDetails = {
      displayName: "EXAMPLE-displayName-Value",
      compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
      clusterSize: 16,
      customerShippingAddress: {
        addressee: "EXAMPLE-addressee-Value",
        careOf: "EXAMPLE-careOf-Value",
        address1: "EXAMPLE-address1-Value",
        address2: "EXAMPLE-address2-Value",
        address3: "EXAMPLE-address3-Value",
        address4: "EXAMPLE-address4-Value",
        cityOrLocality: "EXAMPLE-cityOrLocality-Value",
        stateOrRegion: "EXAMPLE-stateOrRegion-Value",
        zipcode: "EXAMPLE-zipcode-Value",
        country: "EXAMPLE-country-Value",
        phoneNumber: "EXAMPLE-phoneNumber-Value",
        email: "EXAMPLE-email-Value"
      },
      clusterWorkloads: [
        {
          name: "EXAMPLE-name-Value",
          compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
          id: "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
          size: "EXAMPLE-size-Value",
          objectCount: "EXAMPLE-objectCount-Value",
          prefix: "EXAMPLE-prefix-Value",
          rangeStart: "EXAMPLE-rangeStart-Value",
          rangeEnd: "EXAMPLE-rangeEnd-Value",
          workloadType: "EXAMPLE-workloadType-Value",
          workRequestId: "ocid1.test.oc1..<unique_ID>EXAMPLE-workRequestId-Value"
        }
      ],
      clusterType: rover.models.ClusterType.Station,
      superUserPassword: "EXAMPLE-superUserPassword-Value",
      enclosureType: rover.models.EnclosureType.NonRuggadized,
      unlockPassphrase: "EXAMPLE-unlockPassphrase-Value",
      pointOfContact: "EXAMPLE-pointOfContact-Value",
      pointOfContactPhoneNumber: "EXAMPLE-pointOfContactPhoneNumber-Value",
      shippingPreference: rover.models.CreateRoverClusterDetails.ShippingPreference.OracleShipped,
      shippingVendor: "EXAMPLE-shippingVendor-Value",
      timePickupExpected: new Date("Tue Feb 28 14:57:33 UTC 2023"),
      oracleShippingTrackingUrl: "EXAMPLE-oracleShippingTrackingUrl-Value",
      subscriptionId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value",
      lifecycleState: rover.models.LifecycleState.Active,
      lifecycleStateDetails: "EXAMPLE-lifecycleStateDetails-Value",
      isImportRequested: false,
      importCompartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-importCompartmentId-Value",
      importFileBucket: "EXAMPLE-importFileBucket-Value",
      dataValidationCode: "EXAMPLE-dataValidationCode-Value",
      masterKeyId: "ocid1.test.oc1..<unique_ID>EXAMPLE-masterKeyId-Value",
      freeformTags: {
        EXAMPLE_KEY_kCWY5: "EXAMPLE_VALUE_ESzVnJ1vW80zsq93ZU5Q"
      },
      definedTags: {
        EXAMPLE_KEY_hAq3j: {
          EXAMPLE_KEY_ENm9m: "EXAMPLE--Value"
        }
      },
      systemTags: {
        EXAMPLE_KEY_NRMmG: {
          EXAMPLE_KEY_4weyX: "EXAMPLE--Value"
        }
      }
    };

    const createRoverClusterRequest: rover.requests.CreateRoverClusterRequest = {
      createRoverClusterDetails: createRoverClusterDetails,
      opcRetryToken: "EXAMPLE-opcRetryToken-Value",
      opcRequestId: "R1URSTP1GT3YYR59SXJO<unique_ID>"
    };

    // Send request to the Client.
    const createRoverClusterResponse = await client.createRoverCluster(createRoverClusterRequest);
  } catch (error) {
    console.log("createRoverCluster Failed with error  " + error);
  }
})();